﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameStatistic : MonoBehaviour {

	public static GameStatistic instance;
	public ItemData[] ballPrice;
	public ItemData[] mapPrice;
	private void Awake()
	{
		instance = this;
	}
	private int gameScore;
	public static int GameScore
	{
		get { return instance.gameScore;}
	}
	public static void AddScore(int score=1)
	{
		if (score == -1) {
			instance.gameScore = 0;
			return;
		}
		instance.gameScore += score;
	}
	public static int HighScore
	{
		get { return PlayerPrefs.GetInt("highScore");}
	}
	public static void SetHighScore()
	{
		if (GameScore > HighScore)
			PlayerPrefs.SetInt ("highScore", GameScore);
	}
	public static int Coin
	{
		get { return PlayerPrefs.GetInt("coin");}
	}
	public static void AddCoin(int coin = 1)
	{
		PlayerPrefs.SetInt ("coin",Coin+ coin);
	}
}

public enum ItemType
{
	BALL,
	MAP
}
[System.Serializable]
public class ItemData
{
	public int price;
}
